<template>
    <div class="app-container min-h-full">
        <y-form ref="formRef" :options="formOptions" @submit="submit"></y-form>
    </div>
</template>

<script>
export default {
    data() {
        return {
            editor: '<p>asdf<img style="display: block; margin-left: auto; margin-right: auto;" src="https://eps.ix2.com/public/web/20250213/40c261b0-2efd-4907-8a95-bf2dc7d806bd1739429480265.jpg" alt="" width="399" height="174" /></p>',
            formOptions: {
                titleWidth: 120,
                items: [
                    {
                        field: 'edit', title: '富文本',
                        itemRender: {
                            name: 'YEditor'
                        }
                    },
                    {
                        align: 'center', span: 24, itemRender: {
                            name: 'VxeButtonGroup',
                            options: [
                                { content: '重置', type: 'reset' },
                                { content: '提交', type: 'submit', status: 'primary' }
                            ]
                        }
                    }
                ]
            }
        }
    },
    mounted() {
        this.$refs.formRef.setData({
            edit: this.editor,
            se: 1
        })
    },
    methods: {
        submit(data) {
            console.log(data)
        }
    }
}
</script>